<template>
  <el-dialog class="full-video" :visible.sync="show" width="80%" :before-close="close" :modal="true">
    <div class="video-box">
      <video :src="url" controls></video>
    </div>
<!--    <el-video :src="url">-->
<!--    </el-video>-->
<!--    <div class="close" @click="close">-->
<!--      <i class="el-icon-close"></i>-->
<!--    </div>-->
  </el-dialog>
</template>

<script>
export default {
  name: "fullVideo",
  data() {
    return {
      show: false,
      url: ''
    }
  },
  methods: {
    // close() {
    //   console.log("close")
    //   this.show = false;
    // },
    open(url) {
      this.url = url;
      this.show = true;  // 显示视频预览
    },
  },
};
</script>

<style scoped>
.full-video {
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  .video-box {
    position: absolute;
    left: 50%;
    top: 50%;
    //transform: translate(-50%, -50%);
    //max-height: 100%;
    max-width: 350px;
  }

  .video-box video {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .close {
    position: fixed;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 25px;
    cursor: pointer;
  }
}
</style>
